home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 53.asm < prev    next >
Assembly Source File  |  1999-09-06  |  1KB  |  42 lines

  1. * 53.asm  demonstrate TLPutilbm     version 0.01     8.6.99
  2.  
  3.  
  4.  include 'Front.i'
  5.  
  6.  
  7. ; TLPutilbm can save a region from any bitmap as an IFF file.
  8. ; This program saves the workbench screen image as an IFF file. The program
  9. ; saves the workbench screen image to a file named "RAM:Temp.iff". You
  10. ; can use Multiview, or a paint program, to load RAM:Temp.iff to check
  11. ; that this program worked ok.
  12.  
  13.  
  14. strings: dc.b 0
  15.  dc.b 'RAM:Temp.iff',0     ;1
  16.  dc.b 'Saved - from the CLI, enter  Multiview RAM:Temp.iff  to view it',0 ;2
  17.  dc.b '(Or, load, assemble & run 53.asm, and input RAM:Temp.iff)',0 ;3
  18.  
  19.  ds.w 0
  20.  
  21.  
  22. * demonstrate  TLPutilbm
  23. Program:
  24.  TLwindow #-1              ;initilise everything
  25.  beq Pr_quit
  26.  
  27.  TLstrbuf #1               ;filename to buffer
  28.  move.l xxp_Screen(a4),a1  ;a1 = the workbench screen
  29.  move.l sc_RastPort+rp_BitMap(a1),a0 ;a0 = the workbench screen's bitmap
  30.  TLputilbm #0,#0,#100,#50,a0  ;save the screen (0,0)-(99,49) in RAM:Temp.iff
  31.  beq.s Pr_bad              ;go if bad
  32.  
  33.  TLreqinfo #2,#2           ;tell user how to view it
  34.  bra.s Pr_quit
  35.  
  36. Pr_bad:                    ;report error if bad
  37.  TLerror
  38.  TLreqchoose
  39.  
  40. Pr_quit:
  41.  rts
  42.